import { defineStore } from 'pinia'
import { getAllUnit } from '@/api/sys/unit'

const useUnitStore = defineStore('UnitStore', {
  state: () => ({
    list: [],
  }),
  actions: {
    getUnit() {
      getAllUnit().then(({ data }) => {
        this.list = data.data
      })
    },
    reset() {
      this.list = []
    },
  },
  getters: {},
})

export default useUnitStore
